#ifndef XMODFILE
#define XMODFILE
#include "XObject.h"
#include "Platform.h"
#include <io.h>
using namespace std;
enum FileMode{
	FM_READ = 1,
	FM_WRITE = 2,
	FM_READ_WRITE = 3,
	FM_APPEND = 4,
	FM_READ_WRITE_APPEND = 5,
	FM_READ_BINARY = 6,
	FM_WRITE_BINARY = 7,
	FM_READ_WRITE_BINARY = 8,
	FM_APPEND_BINARY = 9,
	FM_READ_WRITE_APPEND_BINARY = 10
};
class XM_ENTRY XModFile : public XObject{
private:
	std::string str_file;
	bool b_loaded;
	FILE* f_handle;
public:
	XModFile();
	~XModFile();
	static bool Exist(string file);
	bool OpenFile(string file, FileMode mode);
	void Close();
	bool IsOpen();
	string GetFileName();
	string GetExternName();
	FILE* GetHandle();
	int GetSize();
	static string GetRootPath();
};
#endif